package org.redpig.mimall.controller;

import lombok.extern.slf4j.Slf4j;
import org.redpig.mimall.service.ICategoryService;
import org.redpig.mimall.vo.CategoryVo;
import org.redpig.mimall.vo.ResponseVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("/category")
public class CategoryController {

    private final ICategoryService categoryService;

    @Autowired
    public CategoryController(ICategoryService categoryService) {
        this.categoryService = categoryService;
    }

    @GetMapping
    ResponseVo<List<CategoryVo>> selectAll() {
        return categoryService.selectAll();
    }
}
